package com.hon.legionnaire.negocio.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
 


@Entity
@Table(name = "fornecedor")
@SequenceGenerator(name = "fornecedor_seq", sequenceName = "fornecedor_cod_fornecedor_seq", allocationSize = 1)
@NamedQueries ({	
	@NamedQuery(name = "loadAllFornecedor", query = "from FornecedorVO"),
	@NamedQuery(name = "findFornecedor", query = "from FornecedorVO as c where c.codigo = :codigo"),
	@NamedQuery(name = "findDuplicatedFornecedor", query = "from FornecedorVO as c where c.cnpj = :cnpj and c.codigo != :codigo")
})
public class FornecedorVO extends PessoaVO implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "cod_fornecedor")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "fornecedor_seq")
	private int codigo;
	
	@Column(name = "razao_social", length = 30)
	private String razaoSocial;
	
	@Column(name = "cnpj", length = 24, unique = true)
	private String cnpj;
		
	@Column(name = "email_responsavel", length = 30)
	private String emailResponsavel;
	
	@Column(name = "responsavel", length = 50)
	private String responsavel;
	
	@Column(name = "ramal_responsavel", length = 8)
	private String ramalResponsavel;
	
	public String getRamalResponsavel() {
		return ramalResponsavel;
	}

	public void setRamalResponsavel(String ramalResponsavel) {
		this.ramalResponsavel = ramalResponsavel;
	}

	public String getEmailResponsavel() {
		return emailResponsavel;
	}

	public void setEmailResponsavel(String emailResponsavel) {
		this.emailResponsavel = emailResponsavel;
	}

	public String getResponsavel() {
		return responsavel;
	}

	public void setResponsavel(String responsavel) {
		this.responsavel = responsavel;
	}

	public String getRazaoSocial() {
		return razaoSocial;
	}

	public void setRazaoSocial(String razaoSocial) {
		this.razaoSocial = razaoSocial;
	}

	public String getCnpj() {
		return cnpj;
	}

	public void setCnpj(String cnpj) {
		this.cnpj = cnpj;
	}

	public int getCodigo() {
		return codigo;
	}

	public void setCodigo(int codigo) {
		this.codigo = codigo;
	}

	public FornecedorVO(int codigo, String nome, String telefone1,
			String telefone2, String celular, String email, String comentario,
			Date dataCriacao, Date dataAlteracao, int codigo2, String rg,
			String cpf) {
		super(codigo, nome, telefone1, telefone2, celular, email, comentario,
				dataCriacao, dataAlteracao);
		codigo = codigo2;
	}

	public FornecedorVO() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
	
			
}